package com.zyh.day01

object MatchCaseTest {
  def main(args: Array[String]): Unit = {
    var a = 9;
    val str: String = a match {
      case 1 => println(s"周一"); "星期一"
      case 2 => println(s"周二")
        "星期二"
      case 3 => println(s"周三")
        "星期三"
      case y => println(s"$y")
        "？？？"
    }
    println(s"str = ${str}")
    val dog:Animal = new Dog
    var b = dog match{
      case d:Dog => println("Dog");"a"
      case c:Cat => println("Cat")
      case _ => println("?")
    }
  }
}
class Animal {}
class Dog extends Animal {}
class Cat extends Animal {}